<template>
  <div>
    <!-- v-model:props 用在组件上  自动注册了一个自定义事件 update:props名字 -->
    <Son :money="money" @handlePay="fatherPay" v-model:car="car"></Son>
  </div>
</template>

<script>
import { ref } from 'vue'
import Son from './components/Son.vue'
export default {
  components: {
    Son
  },
  setup () {
    const money = ref(100)
    const car = ref('兰博基尼')
    const fatherPay = (val) => {
      console.log(val)
      money.value = val
    }
    return {
      money,
      car,
      fatherPay
    }
  }
}
</script>

<style>

</style>
